const http = require("http");
const fs = require("fs");
const url = require("url");
const { log } = require("console");

const hostname = "127.0.0.1";
const port = 8003;
const server = http.createServer();
server
  .on("request", function (req, res) {
    res.writeHead(200, { "content-type": "text/text;charset=utf-8" });
    res.write(url.parse(req.url, true).query);
    res.end();
  })
  .listen(port, hostname, () => {
    console.log(`服务器启动成功,可以通过 http://${hostname}:${port} 来访问`);
  });
